package com.example.core.config;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: service
 * @description: listener
 * @author: admin
 * @create: 2021-04-08 17:47
 **/
public class StringExcelListener extends AnalysisEventListener {

    private List<List<String>> datas = new ArrayList<>();
    @Override
    public void invoke(Object object, AnalysisContext context) {
        @SuppressWarnings("unchecked") Map<String, String> stringMap = (HashMap<String, String>) object;
        datas.add(new ArrayList<>(stringMap.values()));
        //
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }

    public List<List<String>> getDatas() {
        return datas;
    }

    public void setDatas(List<List<String>> datas) {
        this.datas = datas;
    }

}
